/*
 * JaCoLiB
 * Copyright (C) 2008 Alessandro Serra
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package it.gashale.jacolib.console;

import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Reader;

public class SimpleConsole implements ConsoleInterface {
	private Reader m_in;
	private PrintStream m_out;
	private PrintStream m_err;
	
	public SimpleConsole(Reader in, PrintStream out, PrintStream err) {
		m_in=in;
		m_out=out;
		m_err=err;
	}
	public Reader getIn() {
		return m_in;
	}
	public void setIn(Reader in) {
		m_in=in;
	}
	public void setStandartIn() {
		m_in=new InputStreamReader(System.in);
	}
	public PrintStream getOut() {
		return m_out;
	}
	public void setOut(PrintStream o) {
		m_out=o;
	}
	public void setStandartOut() {
		m_out=new PrintStream(System.out);
	}
	public PrintStream getErr() {
		return m_err;
	}
	public void setErr(PrintStream o) {
		m_err=o;
	}
	public void setStandartErr() {
		m_err=new PrintStream(System.err);
	}
	
	public void print(Object s) {
		m_out.print(s);
	}
	public void println(Object s) {
		m_out.println(s);
	}
	public void error(Object s) {
		m_err.println(s);
	}
	public void printCopyright() {
		println(ConsoleInterface.copyright_message);
	}
}
